package com.lzp.mongodemo.converter;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.core.convert.MongoCustomConversions;

import java.util.Collections;

/**
 * @description: 配置类
 * @author: lzp
 * @createTime: 2021-12-06 00:07
 **/
@Configuration
public class Config {

    /**
     * 将类型转换配置注入到容器中
     *
     * @return
     */
    @Bean
    public MongoCustomConversions mongoCustomConversions() {
        return new MongoCustomConversions(Collections.singletonList(new MoneyReadConverter()));
    }
}
